<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Calcular Esfera</title>

	<script>
       function validar(){
         var nroi = document.calcula.txtRadio.value;

         if (nroi == ""){
            alert('Ingrese radio');
            return false;
         }
   
         document.calcula.action = "EsferaServlet";
         return true;
       }
    </script>


</head>
<body>
<h2>Volumen de la Esfera</h2>

<form name="calcula" action="" method="post" onsubmit="validar()" >
	Radio: <input id="radio" type="text" name="txtRadio" maxlength="3"/>
	<br /> <br />
	<input type="submit" value="Calcular" />
</form> 

<%
	String msg = (String)request.getAttribute("MENSAJE");
	if ( msg != null ) {
		out.println(msg);
	}
%>

<br>
<a href="Bienvenido.jsp">Retornar al menu principal</a>

</body>
</html>